1. Field of the Invention
The present invention relates to an image processing apparatus and method which can reduce the power consumption.
2. Description of the Related Art
Computer graphics are often used in a variety of computer aided design (CAD) systems and amusement machines. Especially, along with the recent advances in image processing techniques, systems using three-dimensional computer graphics are becoming rapidly widespread.
In three-dimensional computer graphics, the color value of each pixel is calculated at the time of deciding the color of each corresponding pixel. Then, rendering is performed for writing the calculated value to an address of a display buffer (frame buffer) corresponding to the pixel.
One of the rendering methods is polygon rendering. In this method, a three-dimensional model is expressed as a composite of triangular unit graphics (polygons). By drawing the polygons as units, the colors of the pixels of the display screen are decided.
In polygon rendering, coordinates (x, y, z), color data (R, G, B, α), homogeneous coordinates (s, t) of texture data indicating a composite image pattern, and a value of the homogeneous term q for the respective vertexes of the triangle in a physical coordinate system are input and processing is performed for interpolation of these values inside the triangle.
Here, the homogeneous term q is, simply stated, like an expansion or reduction rate. Coordinates in a UV coordinate system of an actual texture buffer, namely, texture coordinate data (u, v), are comprised of the homogeneous coordinates (s, t) divided by the homogeneous term q to give “s/q” and “t/q” which in turn are multiplied by texture sizes USIZE and VSIZE respectively.
In the three-dimensional computer graphic system, for example, when drawing in the display buffer (frame buffer), the texture data is read from the texture buffer by using the texture coordinate data (u, v) for every pixel and texture mapping is performed for applying the read texture data in units of triangles on the surface of the three-dimensional model.
Note that in texture mapping on a three-dimensional model, the expansion or reduction rate of the image indicated by the texture data to be applied to each pixel changes.
In a three-dimensional computer graphic system, however, there are some cases for example where processing is performed in parallel (simultaneously) for 8 pixels in a predetermined block.
Also, in the above polygon rendering performed in units of triangles, the reduction rate etc. of the texture data to be applied are determined in units of triangles.
Accordingly, in the results of the 8 pixels' worth of operations processed in parallel, the results of operations on the pixels outside the triangle covered become invalid.
Specifically, as shown in FIG. 12, consider the case where a reduction rate is determined by performing a predetermined operation with respect to a triangle 30 and texture mapping is performed by using texture data in accordance with the reduction rate.
Here, the blocks 31, 32, and 33 are regions where 8 (2×4) bits to be processed in parallel are arranged. In polygon rendering, the same texture data is used for the 8 pixels belonging to one block.
In the case shown in FIG. 12, all of the 8 pixels belonging to the block 32 are located inside the triangle 30, so the results of the operations on the 8 pixels are all the valid “1”. On the other hand, among the 8 pixels belonging to the blocks 31 and 33, 3 pixels are inside the triangle 30 and 5 pixels are outside the triangle 30. Therefore, the results of the operations on 3 pixels are valid in the 8 pixels, but the results of the operations on the 5 pixels become invalid.
In the related art, the polygon rendering was performed unconditionally on all of the 8 pixels in the blocks.
Summarizing the problem to be solved by the present invention, as explained above, when performing the polygon rendering using triangles as unit graphics, if processing is performed on all of the plurality of pixels located in a block regardless of whether they are inside the triangle covered or not, an enormous number of invalid operations are performed, so there is a large effect on the power consumption.
Also, in a three-dimensional computer graphic system, unnecessary operations are performed due to a variety of reasons in addition to the reason above in some cases.
Further, since the clock frequency for operation of a three-dimensional computer graphic system has been becoming very high recently, reduction of the power consumption has become a significant issue.